home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Sample Code / Snippets / Devices / SCSI Simple Sample / Src / DoTestUnitReady.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-24  |  726 b   |  33 lines  |  [TEXT/KAHL]

  1. /*                                DoTestUnitReady.c                                */
  2. /*
  3.  * DoTestUnitReady.c
  4.  * Copyright © 1992-94 Apple Computer Inc. All Rights Reserved.
  5.  */
  6. #include "SCSISimpleSample.h"
  7.  
  8. /*
  9.  * Execute a Test Unit Ready command on the specified device and display
  10.  * the result.
  11.  */
  12. void
  13. DoTestUnitReady(
  14.         DeviceIdent                scsiDevice                /* -> Bus/target/LUN    */
  15.     )
  16. {
  17.  
  18.         ScsiCmdBlock                scsiCmdBlock;
  19. #define SCB    (scsiCmdBlock)
  20.         
  21.         ShowSCSIBusID(scsiDevice, "\pTest Unit Ready");
  22.         CLEAR(SCB);
  23.         SCB.scsiDevice = scsiDevice;
  24.         SCB.command.scsi6.opcode = kScsiCmdTestUnitReady;
  25.         /* All other command bytes are zero */
  26.         DoSCSICommandWithSense(&scsiCmdBlock, TRUE, TRUE);
  27.         if (SCB.status == noErr)
  28.             LOG("\pTest Unit Ready successful");
  29. #undef SCB
  30. }
  31.  
  32.         
  33.